package com.zd.service.lmpl;/**
 * @Description: OutsourcingServicelmpl
 * @Author:pioneer
 * @Date: 2021-07-12
 * @Version:v1.0
 */

import com.zd.mapper.OutsourcingzdMapper;
import com.zd.service.lnter.OutsourcingServicelnter;
import com.zzg.entity.Outsourcing;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: OutsourcingServicelmpl
 * @Author:pioneer
 * @Date: 2021-07-12
 * @Version:v1.0
 */
@Service
public class OutsourcingServicelmpl implements OutsourcingServicelnter {

    @Autowired
    public OutsourcingzdMapper outsourcingzdMapper;
    /**
     * 新增外包信息
     *
     * @param outsourcing 外包对象
     * @return 返回数值判断是否添加成功
     */
    @Override
    public int insertoutsourcing(Outsourcing outsourcing) {
        return outsourcingzdMapper.insertoutsourcing (outsourcing);
    }

    /**
     * 根据外包单号查询
     *
     * @param outsourcingid 外包id
     * @return 外包集合
     */
    @Override
    public List<Outsourcing> getOutsourcingByid(String outsourcingid) {
        return outsourcingzdMapper.getOutsourcingByid (outsourcingid);
    }

    /**
     * 根据外包单号删除其他外包
     *
     * @param orderno 外包单号
     * @return 返回数值判断是否删除成功
     */
    @Override
    public int delectOutsourcing(String orderno) {
        return outsourcingzdMapper.delectOutsourcing (orderno);
    }

    /**
     * 根据货运信息查询外包
     *
     * @param freightInformation 货运id
     * @return 外包集合
     */
    @Override
    public Outsourcing getoutsourcegoodsid(String freightInformation) {
        return outsourcingzdMapper.getoutsourcegoodsid (freightInformation);
    }

    /**
     * 根据货物id修改外包信息
     *
     * @param outsourcingOrder   外包单号
     * @param subcontractDate    转包日期
     * @param freight            外包运费
     * @param type               外包类型
     * @param freightInformation 货物信息
     * @return 返回数值判断是否修改成功
     */
    @Override
    public int updateOutsourcing(String outsourcingOrder, String subcontractDate, String freight, String type, String freightInformation) {
        return outsourcingzdMapper.updateOutsourcing (outsourcingOrder,subcontractDate,freight,type,freightInformation);
    }
}
